package proxy4jdbc3.jdbc;

import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.net.URL;
import java.sql.Array;
import java.sql.Blob;
import java.sql.CallableStatement;
import java.sql.Clob;
import java.sql.Date;
import java.sql.Ref;
import java.sql.SQLException;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Calendar;
import java.util.Map;


public class CallableStatementProxy extends PreparedStatementProxy implements
		CallableStatement {
	
	private CallableStatement realCallableStatement;
	
	@Override
	public CallableStatement getProxyfied() {
		return realCallableStatement;
	}
	public CallableStatementProxy(String sql, ConnectionProxy connectionProxy,
			CallableStatement realCallableStatement) {
		super(sql, connectionProxy, realCallableStatement);
		this.realCallableStatement = realCallableStatement;
	}

	// forwarding methods

	public Date getDate(int parameterIndex) throws SQLException {
		return getProxyfied().getDate(parameterIndex);
	}

	public Date getDate(int parameterIndex, Calendar cal) throws SQLException {
		return getProxyfied().getDate(parameterIndex, cal);
	}

	public Ref getRef(String parameterName) throws SQLException {
		return getProxyfied().getRef(parameterName);
	}

	public Time getTime(String parameterName) throws SQLException {
		return getProxyfied().getTime(parameterName);
	}

	public void setTime(String parameterName, Time x) throws SQLException {
		getProxyfied().setTime(parameterName, x);
	}

	public Blob getBlob(int i) throws SQLException {
		return getProxyfied().getBlob(i);
	}

	public Clob getClob(int i) throws SQLException {
		return getProxyfied().getClob(i);
	}

	public Array getArray(int i) throws SQLException {
		return getProxyfied().getArray(i);
	}

	public byte[] getBytes(int parameterIndex) throws SQLException {
		return getProxyfied().getBytes(parameterIndex);
	}

	public double getDouble(int parameterIndex) throws SQLException {
		return getProxyfied().getDouble(parameterIndex);
	}

	public int getInt(int parameterIndex) throws SQLException {
		return getProxyfied().getInt(parameterIndex);
	}

	public boolean wasNull() throws SQLException {
		return getProxyfied().wasNull();
	}

	public Time getTime(int parameterIndex) throws SQLException {
		return getProxyfied().getTime(parameterIndex);
	}

	public Time getTime(int parameterIndex, Calendar cal) throws SQLException {
		return getProxyfied().getTime(parameterIndex, cal);
	}

	public Timestamp getTimestamp(String parameterName) throws SQLException {
		return getProxyfied().getTimestamp(parameterName);
	}

	public void setTimestamp(String parameterName, Timestamp x)
			throws SQLException {
		getProxyfied().setTimestamp(parameterName, x);
	}

	public String getString(int parameterIndex) throws SQLException {
		return getProxyfied().getString(parameterIndex);
	}

	public void registerOutParameter(int parameterIndex, int sqlType)
			throws SQLException {
		argTraceSet(parameterIndex,  "OUT<index:" +parameterIndex + ", type:"
				+ sqlType + ">");
		getProxyfied().registerOutParameter(parameterIndex, sqlType);
	}

	public void registerOutParameter(int parameterIndex, int sqlType, int scale)
			throws SQLException {
		argTraceSet(parameterIndex,  "OUT<index:" +parameterIndex + ", type:"
				+ sqlType + ", scale:" + scale +">");
		getProxyfied().registerOutParameter(parameterIndex, sqlType,
				scale);

	}

	public void registerOutParameter(int paramIndex, int sqlType,
			String typeName) throws SQLException {
		argTraceSet(paramIndex,  "OUT<index:" +paramIndex + ", type:"
				+ typeName + ">");
		getProxyfied().registerOutParameter(paramIndex, sqlType,
				typeName);
	}

	public byte getByte(String parameterName) throws SQLException {
		return getProxyfied().getByte(parameterName);
	}

	public double getDouble(String parameterName) throws SQLException {
		return getProxyfied().getDouble(parameterName);
	}

	public float getFloat(String parameterName) throws SQLException {
		return getProxyfied().getFloat(parameterName);
	}

	public int getInt(String parameterName) throws SQLException {
		return getProxyfied().getInt(parameterName);
	}

	public long getLong(String parameterName) throws SQLException {
		return getProxyfied().getLong(parameterName);
	}

	public short getShort(String parameterName) throws SQLException {
		return getProxyfied().getShort(parameterName);
	}

	public boolean getBoolean(String parameterName) throws SQLException {
		return getProxyfied().getBoolean(parameterName);
	}

	public byte[] getBytes(String parameterName) throws SQLException {
		return getProxyfied().getBytes(parameterName);
	}

	public void setByte(String parameterName, byte x) throws SQLException {
		getProxyfied().setByte(parameterName, x);
	}

	public void setDouble(String parameterName, double x) throws SQLException {
		getProxyfied().setDouble(parameterName, x);
	}

	public void setFloat(String parameterName, float x) throws SQLException {
		getProxyfied().setFloat(parameterName, x);
	}

	public void registerOutParameter(String parameterName, int sqlType)
			throws SQLException {
		getProxyfied().registerOutParameter(parameterName, sqlType);
	}

	public void setInt(String parameterName, int x) throws SQLException {
		getProxyfied().setInt(parameterName, x);
	}

	public void setNull(String parameterName, int sqlType) throws SQLException {
		getProxyfied().setNull(parameterName, sqlType);
	}

	public void registerOutParameter(String parameterName, int sqlType,
			int scale) throws SQLException {
		getProxyfied().registerOutParameter(parameterName, sqlType,
				scale);
	}

	public void setLong(String parameterName, long x) throws SQLException {
		getProxyfied().setLong(parameterName, x);
	}

	public void setShort(String parameterName, short x) throws SQLException {
		getProxyfied().setShort(parameterName, x);
	}

	public void setBoolean(String parameterName, boolean x) throws SQLException {
		getProxyfied().setBoolean(parameterName, x);
	}

	public void setBytes(String parameterName, byte[] x) throws SQLException {
		getProxyfied().setBytes(parameterName, x);
	}

	public boolean getBoolean(int parameterIndex) throws SQLException {
		return getProxyfied().getBoolean(parameterIndex);
	}

	public Timestamp getTimestamp(int parameterIndex) throws SQLException {
		return getProxyfied().getTimestamp(parameterIndex);
	}

	public void setAsciiStream(String parameterName, InputStream x, int length)
			throws SQLException {
		getProxyfied().setAsciiStream(parameterName, x, length);
	}

	public void setBinaryStream(String parameterName, InputStream x, int length)
			throws SQLException {
		getProxyfied().setBinaryStream(parameterName, x, length);
	}

	public void setCharacterStream(String parameterName, Reader reader,
			int length) throws SQLException {
		getProxyfied().setCharacterStream(parameterName, reader, length);
	}

	public Object getObject(String parameterName) throws SQLException {
		return getProxyfied().getObject(parameterName);
	}

	public void setObject(String parameterName, Object x) throws SQLException {
		getProxyfied().setObject(parameterName, x);
	}

	public void setObject(String parameterName, Object x, int targetSqlType)
			throws SQLException {
		getProxyfied().setObject(parameterName, x, targetSqlType);
	}

	public void setObject(String parameterName, Object x, int targetSqlType,
			int scale) throws SQLException {
		getProxyfied().setObject(parameterName, x, targetSqlType, scale);
	}

	public Timestamp getTimestamp(int parameterIndex, Calendar cal)
			throws SQLException {
		return getProxyfied().getTimestamp(parameterIndex, cal);
	}

	public Object getObject(String parameterName, Map map) throws SQLException {
		return getProxyfied().getObject(parameterName, map);
	}

	public Date getDate(String parameterName, Calendar cal) throws SQLException {
		return getProxyfied().getDate(parameterName, cal);
	}

	public Time getTime(String parameterName, Calendar cal) throws SQLException {
		return getProxyfied().getTime(parameterName, cal);
	}

	public Timestamp getTimestamp(String parameterName, Calendar cal)
			throws SQLException {
		return getProxyfied().getTimestamp(parameterName, cal);
	}

	public void setDate(String parameterName, Date x, Calendar cal)
			throws SQLException {
		getProxyfied().setDate(parameterName, x, cal);
	}

	public void setTime(String parameterName, Time x, Calendar cal)
			throws SQLException {
		getProxyfied().setTime(parameterName, x, cal);
	}

	public void setTimestamp(String parameterName, Timestamp x, Calendar cal)
			throws SQLException {
		getProxyfied().setTimestamp(parameterName, x, cal);
	}

	public short getShort(int parameterIndex) throws SQLException {
		return getProxyfied().getShort(parameterIndex);
	}

	public long getLong(int parameterIndex) throws SQLException {
		return getProxyfied().getLong(parameterIndex);
	}

	public float getFloat(int parameterIndex) throws SQLException {
		return getProxyfied().getFloat(parameterIndex);
	}

	public Ref getRef(int i) throws SQLException {
		return getProxyfied().getRef(i);
	}

	/**
	 * @deprecated
	 */
	public BigDecimal getBigDecimal(int parameterIndex, int scale)
			throws SQLException {
		return getProxyfied().getBigDecimal(parameterIndex, scale);
	}

	public URL getURL(int parameterIndex) throws SQLException {
		return getProxyfied().getURL(parameterIndex);
	}

	public BigDecimal getBigDecimal(int parameterIndex) throws SQLException {
		return getProxyfied().getBigDecimal(parameterIndex);
	}

	public byte getByte(int parameterIndex) throws SQLException {
		return getProxyfied().getByte(parameterIndex);
	}

	public Object getObject(int parameterIndex) throws SQLException {
		return getProxyfied().getObject(parameterIndex);
	}

	public Object getObject(int i, Map map) throws SQLException {
		return getProxyfied().getObject(i, map);
	}

	public String getString(String parameterName) throws SQLException {
		return getProxyfied().getString(parameterName);
	}

	public void registerOutParameter(String parameterName, int sqlType,
			String typeName) throws SQLException {
		getProxyfied().registerOutParameter(parameterName, sqlType,
				typeName);
	}

	public void setNull(String parameterName, int sqlType, String typeName)
			throws SQLException {
		getProxyfied().setNull(parameterName, sqlType, typeName);
	}

	public void setString(String parameterName, String x) throws SQLException {
		getProxyfied().setString(parameterName, x);
	}

	public BigDecimal getBigDecimal(String parameterName) throws SQLException {
		return getProxyfied().getBigDecimal(parameterName);
	}

	public void setBigDecimal(String parameterName, BigDecimal x)
			throws SQLException {
		getProxyfied().setBigDecimal(parameterName, x);
	}

	public URL getURL(String parameterName) throws SQLException {
		return getProxyfied().getURL(parameterName);
	}

	public void setURL(String parameterName, URL val) throws SQLException {
		getProxyfied().setURL(parameterName, val);
	}

	public Array getArray(String parameterName) throws SQLException {
		return getProxyfied().getArray(parameterName);
	}

	public Blob getBlob(String parameterName) throws SQLException {
		return getProxyfied().getBlob(parameterName);
	}

	public Clob getClob(String parameterName) throws SQLException {
		return getProxyfied().getClob(parameterName);
	}

	public Date getDate(String parameterName) throws SQLException {
		return getProxyfied().getDate(parameterName);
	}

	public void setDate(String parameterName, Date x) throws SQLException {
		getProxyfied().setDate(parameterName, x);

	}
}
